<!-- 聊天记录 -->
<template>
  <ToolbarItemContainer :iconFile="Icon" title="聊天记录" :needBottomPopup="true"
    :iconWidth="isUniFrameWork ? '26px' : '20px'" :iconHeight="isUniFrameWork ? '26px' : '20px'" :needDialog="false"
    @onIconClick="onIconClick" ref="container" />
</template>
<script setup lang="ts">
import { TUIStore, StoreName, IConversationModel } from '@tencentcloud/chat-uikit-engine'
import { ref } from '@/TUIKit/adapter-vue'
import ToolbarItemContainer from '@/TUIKit/components/TUIChat/message-input-toolbar/toolbar-item-container/index.vue'
import { isEnabledMessageReadReceiptGlobal } from '@/TUIKit/components/TUIChat/utils/utils'
import { isPC, isUniFrameWork } from '@/TUIKit/utils/env'
import Icon from '@/TUIWidget/static/icon/history.png'

const currentConversation = ref<IConversationModel>()
const container = ref()

TUIStore.watch(StoreName.CONV, {
  currentConversation: (conversation: IConversationModel) => {
    currentConversation.value = conversation
  },
})

/** 点击事件 */
const onIconClick = () => {
  console.log('-- 聊天记录 ---------------->')

  uni.navigateTo({
    url: `/TUIWidget/chat-history/index`,
  })
}
</script>
<style scoped lang="scss" src="./style/index.scss"></style>
